import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import http from './http/http'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import paging from './components/publicCom/paging'
import diySelect from './components/publicCom/diySelect'
import deleteDialog from './components/publicCom/deleteDialog'
import echarts from 'echarts';
Vue.use(paging)
Vue.use(diySelect)
Vue.use(deleteDialog)
Vue.component('paging',paging)
Vue.component('diySelect',diySelect)
Vue.component('deleteDialog',deleteDialog)
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$axios = http
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
//员工页面用于解决后端传来的时间变成一串数字问题
Date.prototype.format = function(format){
  var o = {
    "M+" : this.getMonth()+1, //month
    "d+" : this.getDate(), //day
    "h+" : this.getHours(), //hour
    "m+" : this.getMinutes(), //minute
    "s+" : this.getSeconds(), //second
    "q+" : Math.floor((this.getMonth()+3)/3), //quarter
    "S" : this.getMilliseconds() //millisecond
  };
  if(/(y+)/i.test(format)) {
    format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
  }
  for(var k in o) {
    if(new RegExp("("+ k +")").test(format)) {
      format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
    }
  }
  return format;
};
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
